package concurrency;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import net.mindview.util.CountingGenerator;
import net.mindview.util.MapData;

class SynchronizedHashMapTest extends MapTest {
    SynchronizedHashMapTest(int readers, int writers) {
        super("Synched HashMap", readers, writers);
    }

    @Override
    Map<Integer, Integer> containerInitializer() {
        MapData<Integer, Integer> md = MapData.map(new CountingGenerator.Integer(), new CountingGenerator.Integer(), sContainerSize);
        HashMap<Integer,Integer> hashMap = new HashMap<Integer,Integer>(md);
        Map<Integer,Integer> map = Collections.synchronizedMap(hashMap);
        return map;
    }
}
